import React, { useState } from "react";
import { Input, Button } from "antd";
import { useNavigate } from "react-router-dom";
import { issue_list_search } from "../../../../utils/api/index";
interface Props {
  changedepositlist: any;
}
function DepositListtop(props: Props) {
  var [data, setData] = useState("");
  var navigate = useNavigate();
  var creat = function () {
    navigate("/index/home/deposit/depositList/createdeposit");
  };
  //搜索
  var search = function () {
    issue_list_search({ renyuan: data }).then((res) => {
      // console.log("search",res.data);
      props.changedepositlist(res.data);
    });
  };
  var handlenchange = function (event: any) {
    const { value } = event.target;
    setData(value);
    // console.log(event.target);
  };
  return (
    <div className="depositListtop">
      <div className="head">仓储管理 / 出库管理 / 出库列表</div>
      <div className="middle">
        <Input defaultValue={data} placeholder="请输入单号" />
        <Input defaultValue={data} placeholder="请选择仓库" />
        <Input
          defaultValue={data}
          onChange={handlenchange}
          placeholder="请选择出库人员"
        />
        {/* <Form.Item >
          <DatePicker  className="date"  placeholder="请选择申请日期"  />
        </Form.Item> */}
        <Input defaultValue={data} placeholder="请选择状态" />
        <Button type="primary" onClick={search}>
          搜索
        </Button>
        <Button type="primary" onClick={creat}>
          创建
        </Button>
        <Button type="primary">导出</Button>
      </div>
    </div>
  );
}

export default DepositListtop;
